﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class TeacherDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            Selected(Request.QueryString["ID"]);
        }
    }

    private void Selected(string id)
    {
        string sql_select_one_teacher_info = @"select * from Teacher_Info where teaID="+id;
        DataTable dt = DataAccess.GetDataTable(sql_select_one_teacher_info, null);

        /*
         * teaID int primary key identity(1,1),-- 教师编号（主键）
teaName nvarchar(10) NOT NULL,-- 教师姓名
teaSex  nchar(1) not null,--教师性别
teaPost  nvarchar(10),--教师职称
teaPhoto nvarchar(50),--教师照片地址
teaSubject nvarchar(50), --教师授课课程(分隔用"|")
teaInfo ntext,--教师信息
         */
        lblName.Text = dt.Rows[0]["teaName"].ToString();
        lblPosition.Text = "职称:" + dt.Rows[0]["teaPost"].ToString();
        lblSex.Text = "性别：" + dt.Rows[0]["teaSex"].ToString();
        lblLesson.Text = "所授课程：" + dt.Rows[0]["teaSubject"].ToString();
        lblContent.Text = dt.Rows[0]["teaInfo"].ToString();
    }
}